﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace ReservationModule
{
    public partial class CheckRoomAvailiblity : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["Login"] = Session["Login"];
            if (Session["Login"] == "false" || Session["Login"] == null)
            {
                Response.Redirect("Reject.aspx");
            }
        }

        protected void btnCheck_Click(object sender, EventArgs e)
        {
            DateTime checkinDate = Convert.ToDateTime(tbxCheckInDate.Text);
            DateTime checkoutDate = Convert.ToDateTime(tbxCheckOutDate.Text);
            string roomtype = rblRoomTypes.Text;

            int r = DBManager.GetRoomAvailibilityByDates(checkinDate, checkoutDate, roomtype);
            Label1.Text = Convert.ToString(r);
        }
    }
}